#pragma once


#include"RBTree.h"


namespace bit
{
	template<class k>
	class set
	{
		struct SetKeyofT
		{
			const k& operator()(const k& key)
			{
				return key;
			}
		};
	public:
		typedef typename RBTree<k, const k, SetKeyofT>::iterator iterator;
		typedef typename RBTree<k, const k, SetKeyofT>::Constiterator const_iterator;
		set() = default;

		set(const set<k>& key)
			:_root(key._root)
		{ }

		pair<iterator, bool> insert(const k& key)
		{
			return _root.Insert(key);
		}

		iterator begin()
		{
			return _root.begin();
		}

		const_iterator begin()const
		{
			return _root.begin();
		}

		iterator end()
		{
			return _root.end();
		}

		const_iterator end()const
		{
			return _root.end();
		}


		iterator find(const k& key)
		{
			return _root.Find(key);
		}

		bool empty()
		{
			return _root.empty();
		}

	private:

		RBTree<k,const k, SetKeyofT> _root;

	};
}
